//package com.charley.icloud.admin.controller;
//
//import cn.hutool.core.bean.BeanUtil;
//import com.charley.icloud.admin.pojo.entity.SysConfigDO;
//import com.charley.icloud.admin.pojo.request.SysConfigQuery;
//import com.charley.icloud.admin.service.SysConfigService;
//
//import com.charley.icloud.datasource.page.PageRequest;
//import io.swagger.v3.oas.annotations.Operation;
//import io.swagger.v3.oas.annotations.Parameter;
//import io.swagger.v3.oas.annotations.enums.ParameterIn;
//import io.swagger.v3.oas.annotations.tags.Tag;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.annotation.Resource;
//import java.util.ArrayList;
//import java.util.List;
//
//@RestController
//@RequestMapping("config")
//@Tag(name = "系统配置控制器", description = "系统配置控制器")
//public class SysConfigController {
//
//    @Resource
//    private SysConfigService sysConfigService;
//
//    @PostMapping(value = "/save")
//    @Operation(summary = "保存配置", description = "后台管理系统")
//    @Parameter(name = "query", description = "配置信息", required = true, in = ParameterIn.QUERY)
//    public HttpResult save(@RequestBody SysConfigQuery query) {
//        SysConfigDO record = new SysConfigDO();
//        if (query != null) {
//            BeanUtil.copyProperties(query, record, true);
//        }
//        return HttpResult.ok(sysConfigService.save(record));
//    }
//
//    @PostMapping(value = "/delete")
//    @Operation(summary = "删除配置", description = "后台管理系统")
//    @Parameter(name = "queries", description = "配置信息删除列表", required = true, in = ParameterIn.QUERY)
//    public HttpResult delete(@RequestBody List<SysConfigQuery> queries) {
//        List<SysConfigDO> records = new ArrayList<>();
//        if (queries != null && queries.size() > 0) {
//            for (SysConfigQuery query : queries) {
//                SysConfigDO sysConfigDO = new SysConfigDO();
//                BeanUtil.copyProperties(query, sysConfigDO, true);
//                records.add(sysConfigDO);
//            }
//        }
//        return HttpResult.ok(sysConfigService.delete(records));
//    }
//
//    @PostMapping(value = "/findPage")
//    @Operation(summary = "分页查询", description = "后台管理系统")
//    @Parameter(name = "pageRequest", description = "分页信息", required = true, in = ParameterIn.QUERY)
//    public HttpResult findPage(@RequestBody PageRequest pageRequest) {
//        return HttpResult.ok(sysConfigService.findPage(pageRequest));
//    }
//
//    @GetMapping(value = "/findByLable")
//    @Operation(summary = "根据标签查询", description = "后台管理系统")
//    @Parameter(name = "lable", description = "标签名称", required = true, in = ParameterIn.PATH)
//    public HttpResult findByLable(@RequestParam String lable) {
//        return HttpResult.ok(sysConfigService.findByLable(lable));
//    }
//}
